#ifndef _DEMURA_H_
#define _DEMURA_H_

//#include "stm32fxxx.h"
#include "SSD2832.h"
//#include <stdio.h> 
//#include <stdlib.h> 
#include <ctype.h>                      /* Character functions                */
//-----------------------------------------------------------------------------------------
extern u32 VCP_Receive_True_num;   //单次Mura数据接收累计
extern u32 USB_Rx_Demura_Total_Num;//Mura数据接收全累计
extern u32 USB_Tx_Demura_Num;
extern u32 USB_Rx_Demura_Total_Num_Temp;
extern u32 USB_Rx_Demura_Num;
extern u32 USB_Rx_Demura;

extern u8  USB_Rx_Demura_End_Flag; //Demura数据全部完成标志
extern u8  DemuraIctype;  		  	 //识别IC型号
extern u8  Demura_OLEDModule_flag; //同型DDIC下的衍生项目
extern u32 Demura_START_FLAG;  		 //Demura 数据传输开始标志

extern u32 DemuraRecivedNum;       //统计已经接收的数据数量
extern u32 DemuraTransOnce;        //单笔Demura资料传输数据量
extern u8  Demura_first_package_flag;  //首次发送标志 2C/3C use
//-----------------------------------------------------------------------------------------
//项目编号预定义，同上位机一致
#define  R66455_GM820  0
#define  R66456_GM825  1
#define  RM692A6_GM830  2
#define  RM692A9_GM870  3
#define  RM69298_GM720  4 
//------------------------
#define  RM69299_FM720  5
#define  RM69298_GM760  6
#define  RM69350_GM620  7
#define  NT37700C_GM820 8
#define  VT5100_GM870  9
//------------------------
#define  RM692C9_GM8A0  10
#define  RM692A9_GM8A0  11
#define  RM69200_GM8A0  12
#define  RM692A9_GT666  13
#define  RM692C4_F4  14
//------------------------
#define  R66451_ALPHA   15
#define  SD5202_GM583  	16  //SD5202
#define  RM69351_GM920  17
#define  R66451_GM862   18
#define  NT37701_FM010  19
//------------------------
#define  RM692C9_GM828  20
#define  VT6110C_GM8A0  21
#define  VT6110_GM750   22
#define  RM692C9_GM010  23 //3.92
#define  RM692C9_GM930  24  //6.92
#define  RM692D7_GM920  25  
//------------------------
#define  NT37800A_GM862 26  //6.65
#define	 NT37701A_GM040 27  //6.8
#define	 RM692EX_DemuraIP 28  //
<<<<<<< HEAD
#define  RM692D9_GM930    29  //6.92
=======
#define  VT6110C_601          30   //6.01
>>>>>>> mjb



void Write_Data_to_Demura_RAM(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
extern void SSD2828_W_RAM_demura_buffer_part_rgb(float pclk,u8 SigMode ,u8* buffer ,u16 length,u8  multiple ,u8 DisMode);
extern void SSD2828_W_RAM_demura_buffer_part_bgr(float pclk,u8 SigMode ,u8* buffer ,u16 length,u8  multiple ,u8 DisMode);
//Demura
//--Demura用--
void DemuraData2DDICRam(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void Demura_shenxian(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void SSD2828_W_RAM_demura_buffer_part_bgr(float pclk,u8 SigMode ,u8* buffer ,u16 length,u8  multiple ,u8 DisMode);
void Demura2RAM(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);



//---定义各型号+项目代号-----
extern void R66455_GM820_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
extern void R66456_GM825_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
extern void RM692A6_GM830_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void RM692A9_GM870_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void RM69350_GM620_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void RM69351_GM920_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void NT37700C_GM820_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void R66451_ALPHA_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void R66451_GM862_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void SD5202_GM583_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
//extern void RM69298_GM720_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void RM69298_GM760_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void RM692C9_GM828_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void RM692C9_GM930_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void RM692D7_GM920_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void NT37800A_GM862_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void NT37701A_GM040_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
extern void RM692EX_DemuraIP_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
<<<<<<< HEAD
extern void RM692Dx_GM930_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8* buffer,u16 LP_B7_Data,u16 HS_B7_Data);
=======
extern void VT6110C_601_Write_Demura_Ram(USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
>>>>>>> mjb

//--Demura用--
void ProcessForDmuR00( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR01( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR02( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR03( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR04( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR05( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR06( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR07( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR08( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR09( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR0A( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR0B( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR0C( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR0D( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR0E( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR0F( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR10( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR13( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR14( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR15( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR18( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR19( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR1A( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);												
void ProcessForDmuR1B( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR1C( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR1F( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR20( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR21( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);//ADD BY PCS
void ProcessForDmuR59( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);
void ProcessForDmuR60( USBD_HandleTypeDef *pdev,uint8_t  ep_addr,u8 SigMode ,u8 channel,u8 buffer[],u16 LP_B7_Data,u16 HS_B7_Data);//SK VTDR demura
#endif
